﻿using MediatR;
using Microsoft.AspNetCore.Mvc;
using OrderModule.Application.Commands;

namespace OrderModule.Host.WebAPI.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class OrderController(IMediator _mediator) : ControllerBase
    {
        [HttpPost]
        public async Task<Domain.OrderAggregate.Order> Create(CreateOrderCommand command)
        {
            return await _mediator.Send(command, HttpContext.RequestAborted);
        }
    }
}
